package myenum;



interface inter{
   void    info();
}
public enum EnumGenerator2 implements inter{
        MALE("nan")
        {
           public void info()
            {
                System.out.println("男");
            }

        },
    FAMALE("nv"){
        public void info() {
            System.out.println("女");
        }
    };
    private final String name;
    private  EnumGenerator2(String name){
        this.name=name;
    }

    public String getName() {
        return name;
    }
}

class test3{
    public static void main(String[] args) {
        EnumGenerator2[] values = EnumGenerator2.values();
        for (EnumGenerator2 value : values) {
            System.out.println(value.getName());
            value.info();

        }
    }
}

